﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DevExpress.Xpo;
namespace ChuanPlus
{
    public class Production : XPLiteObject
    {
        int fProductionID;
        [Key(true)]
        public int ProductionID
        {
            get { return fProductionID; }
            set { SetPropertyValue<int>("ProductionID", ref fProductionID, value); }
        }
        Stock fStockID;
        public Stock StockID
        {
            get { return fStockID; }
            set { SetPropertyValue<Stock>("StockID", ref fStockID, value); }
        }
        DateTime fProductionDate;
        public DateTime ProductionDate
        {
            get { return fProductionDate; }
            set { SetPropertyValue<DateTime>("ProductionDate", ref fProductionDate, value); }
        }
        double fTotalUsed;
        public double TotalUsed
        {
            get { return fTotalUsed; }
            set { SetPropertyValue<double>("TotalUsed", ref fTotalUsed, value); }
        }
        string fPacking;
        [Size(20)]
        public string Packing
        {
            get { return fPacking; }
            set { SetPropertyValue<string>("Packing", ref fPacking, value); }
        }
        double fBalance;
        public double Balance
        {
            get { return fBalance; }
            set { SetPropertyValue<double>("Balance", ref fBalance, value); }
        }
        double fLoss;
        public double Loss
        {
            get { return fLoss; }
            set { SetPropertyValue<double>("Loss", ref fLoss, value); }
        }
        string fRemarks;
        [Size(200)]
        public string Remarks
        {
            get { return fRemarks; }
            set { SetPropertyValue<string>("Remarks", ref fRemarks, value); }
        }
        [Association("Production-ProductionDetails")]
        public XPCollection<ProductionDetails> ProductionDetails { get { return GetCollection<ProductionDetails>("ProductionDetails"); } }

        string fStatus;
        public string Status
        {
            get { return fStatus; }
            set { SetPropertyValue<string>("Status", ref fStatus, value); }
        }
        public Production(Session session) : base(session) { }
        public Production() : base(Session.DefaultSession) { }
        /// <summary>
        /// Initializes a new instance of the Production class.
        /// </summary>
        /// <param name="fProductionID"></param>
        /// <param name="fID"></param>
        /// <param name="fProductionDate"></param>
        /// <param name="fTotalUsed"></param>
        /// <param name="fPacking"></param>
        /// <param name="fBalance"></param>
        /// <param name="fLoss"></param>
        /// <param name="fRemarks"></param>
        public Production(Session session, Stock fStockID, DateTime fProductionDate, double fTotalUsed, string fPacking, double fBalance, double fLoss, string fRemarks,string fStatus)
            : base(session)
        {
            
            this.fStockID = fStockID;
            this.fProductionDate = fProductionDate;
            this.fTotalUsed = fTotalUsed;
            this.fPacking = fPacking;
            this.fBalance = fBalance;
            this.fLoss = fLoss;
            this.fRemarks = fRemarks;
            this.fStatus = fStatus;
                 
        }
        public override void AfterConstruction() { base.AfterConstruction(); }
    }
}
